klass->notify_gtk (obj, pspec);
}
-/* Translate GtkWidget::size-allocate to AtkComponent::bounds-changed */
-static void
-size_allocate_cb (GtkWidget *widget,
- int width,
- int height)
+/*< private >
+ * gtk_widget_accessible_update_bounds:
+ * @self: a #GtkWidgetAccessible
+ *
+ * Updates the bounds of the widget's accessible implementation using
+ * the widget's allocation.
+ */
+void
+gtk_widget_accessible_update_bounds (GtkWidgetAccessible *self)
{
- AtkObject* accessible;
+ GtkAllocation alloc;
AtkRectangle rect;
- accessible = gtk_widget_get_accessible (widget);
- if (ATK_IS_COMPONENT (accessible))
- {
- GtkAllocation alloc;
- gtk_widget_get_allocation (widget, &alloc);
+ GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (self));
+ gtk_widget_get_allocation (widget, &alloc);
- rect.x = alloc.x;
- rect.y = alloc.y;
- rect.width = alloc.width;
- rect.height = alloc.height;
+ rect.x = alloc.x;
+ rect.y = alloc.y;
+ rect.width = alloc.width;
+ rect.height = alloc.height;
- g_signal_emit_by_name (accessible, "bounds-changed", &rect);
- }
+ g_signal_emit_by_name (self, "bounds-changed", &rect);
}
/* Translate GtkWidget mapped state into AtkObject showing */
widget = GTK_WIDGET (data);
g_signal_connect (widget, "notify", G_CALLBACK (notify_cb), NULL);
- g_signal_connect (widget, "size-allocate", G_CALLBACK (size_allocate_cb), NULL);
g_signal_connect (widget, "map", G_CALLBACK (map_cb), NULL);
g_signal_connect (widget, "unmap", G_CALLBACK (map_cb), NULL);
#include "gtknativeprivate.h"
#include "gtkconstraint.h"
-#include "a11y/gtkwidgetaccessible.h"
+#include "a11y/gtkwidgetaccessibleprivate.h"
#include "inspector/window.h"
#include "gdk/gdkeventsprivate.h"
gtk_widget_update_paintables (widget);
+ if (priv->accessible != NULL)
+ gtk_widget_accessible_update_bounds (GTK_WIDGET_ACCESSIBLE (priv->accessible));
+
skip_allocate:
if (size_changed || baseline_changed)
gtk_widget_queue_draw (widget);